/**
 * 单选模式下，显示当前选中的账号信息
 */
import c from 'classnames'
import type { OrderedSet } from 'immutable'
import type { BaseAccount } from '@/services/auth'
import './SingleChoosed.module.less'

export default function SingleChoosed(props: {
  choosed: OrderedSet<string>
  accountMap: Map<string, BaseAccount>
}) {
  const { choosed, accountMap } = props
  const account = accountMap.get(choosed.first())

  return <div styleName={c('single-choosed', account ? 'show' : '')}>
    {account ? (
      <>
        当前选中：<span styleName="name">{account.name}</span>
      </>
    ) : null}
  </div>
}
